/**   
* @Title: CommitResult.java
* @Package me.paxos.bean
* @Description: TODO
* @author xaoyaoyao
* @date Dec 25, 2018 11:46:08 AM
* @version V1.0   
*/
package me.paxos.bean;

/**
 * @ClassName: CommitResult
 * @Description: 提议者向决策者确认时，决策者的确认回复
 * @author xaoyaoyao
 * @date Dec 25, 2018 11:46:08 AM
 * 
 */
public class CommitResult {

	// 提交的提案是否被接受
	private boolean accepted = false;
	// 决策者的状态
	private AcceptorStatus acceptorStatus = AcceptorStatus.NONE;
	// 返回的决策者已确认的提案
	private Proposal proposal = null;

	/**
	 * @return accepted
	 */
	public boolean isAccepted() {
		return accepted;
	}

	/**
	 * @param accepted
	 *            the accepted to set
	 */
	public void setAccepted(boolean accepted) {
		this.accepted = accepted;
	}

	/**
	 * @return acceptorStatus
	 */
	public AcceptorStatus getAcceptorStatus() {
		return acceptorStatus;
	}

	/**
	 * @param acceptorStatus
	 *            the acceptorStatus to set
	 */
	public void setAcceptorStatus(AcceptorStatus acceptorStatus) {
		this.acceptorStatus = acceptorStatus;
	}

	/**
	 * @return proposal
	 */
	public Proposal getProposal() {
		return proposal;
	}

	/**
	 * @param proposal
	 *            the proposal to set
	 */
	public void setProposal(Proposal proposal) {
		this.proposal = proposal;
	}

	@Override
	public String toString() {
		return "CommitResult [accepted=" + accepted + ", acceptorStatus=" + acceptorStatus + ", proposal=" + proposal + "]";
	}
}
